package com.training.java.corejava.equals;

public class Car
{
	private String vinNumber;
	private String make;
	private String model;
	private String color;
	
	Car(){}
	Car(String vinNumber,String make,String model)
	{
		this.vinNumber=vinNumber;
		this.make=make;
		this.model=model;
	}
	public String getVinNumber() {
		return vinNumber;
	}
	public String getMake() {
		return make;
	}
	public String getModel() {
		return model;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	
	@Override
	public  boolean equals(Object obj)
	{
		if (obj instanceof Car)
		{
			Car car= (Car)obj;
			
			return this.vinNumber.equals(car.vinNumber);
		}
		else
		{
		    return false;
		}
	}
	
	


}
